package com.treasure.mall.biz.bo.module;

import com.treasure.mall.zbq.common.ienum.banner.ModuleType;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * <p>
 * +---------------------------------------------------------
 * * @package: com.treasure.mall.biz.bo.module
 * * @author: guomw (guomwchen@foxmail.com)
 * * @date: 2020/8/8 10:13 上午
 * * @since: V1.0.0
 * +---------------------------------------------------------
 * 注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目的
 *
 */
@Data
public class HomeConfig implements ModuleBase {
    /**
     * 模块类型
     *
     * @return
     */
    @Override
    public ModuleType getModuleType() {
        return ModuleType.MODULE_HOME;
    }

    /**
     * 标题
     */
    private String title;

    /**
     * 视频地址
     */
    private String videoUrl;
    /**
     * 商品ID
     */
    private Long goodsId;

    /**
     * 商品配置信息
     */
    private List<HomeGoodsConfig> goodsList;

    public List<HomeGoodsConfig> getGoodsList() {

        if (goodsList == null || goodsList.size() == 0) {
            List<HomeGoodsConfig> list = new ArrayList<>();
            list.add(new HomeGoodsConfig("", "", null));
            list.add(new HomeGoodsConfig("", "", null));
            list.add(new HomeGoodsConfig("", "", null));
            list.add(new HomeGoodsConfig("", "", null));
            this.goodsList = list;
        }
        return goodsList;
    }

}
